]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Make Notification._onClicked handler public
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 18 Feb 2015 23:00:25 +0000 (00:00 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Feb 2015 16:39:25 +0000 (17:39 +0100)
When we will start to show notifications in the date drop-down, we
will not use the actual notification actor, but construct our own UI
based on Calendar.Message. This is similar to what we already do in
the lock screen, except that in this case clicking the notification
should activate the default action.
So rename the existing _onClicked() method to activate() to make it
clear that such use is acceptable. While not strictly necessary, also
rename the corresponding signal to match.

https://bugzilla.gnome.org/show_bug.cgi?id=744817

js/ui/components/autorunManager.js
js/ui/components/telepathyClient.js
js/ui/messageTray.js
js/ui/notificationDaemon.js
js/ui/windowAttentionHandler.js

index 66a00db3d664d24332b3f1bcf7b7e289f2b5de94..59f5a048ddde3891b18590ceb8b43754e6b53218 100644 (file)
@@ -363,7 +363,7 @@ const AutorunNotification = new Lang.Class({
         return button;
     },
 
-    _onClicked: function() {
+    activate: function() {
         this.parent();
 
         let app = Gio.app_info_get_default_for_type('inode/directory', false);
index f6df9057810d77930e12e4f92ffd13ede1b4f6ad..7758ee2f633dbc11f75f64278c725a4c63f45f77 100644 (file)
@@ -451,7 +451,7 @@ const ChatSource = new Lang.Class({
         this._closedId = this._channel.connect('invalidated', Lang.bind(this, this._channelClosed));
 
         this._notification = new ChatNotification(this);
-        this._notification.connect('clicked', Lang.bind(this, this.open));
+        this._notification.connect('activated', Lang.bind(this, this.open));
         this._notification.setUrgency(MessageTray.Urgency.HIGH);
         this._notifyTimeoutId = 0;
 
index ffc79a220f97b45c733411de01682d68053a77ea..4fe17f5dce82cbb8da43c84a5c478a6284ef7328 100644 (file)
@@ -513,7 +513,7 @@ const Notification = new Lang.Class({
         this.actor = new St.Button({ accessible_role: Atk.Role.NOTIFICATION });
         this.actor.add_style_class_name('notification-unexpanded');
         this.actor._delegate = this;
-        this.actor.connect('clicked', Lang.bind(this, this._onClicked));
+        this.actor.connect('clicked', Lang.bind(this, this.activate));
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
 
         this._table = new St.Table({ style_class: 'notification',
@@ -1077,8 +1077,8 @@ const Notification = new Lang.Class({
         this.actor.add_style_class_name('notification-unexpanded');
     },
 
-    _onClicked: function() {
-        this.emit('clicked');
+    activate: function() {
+        this.emit('activated');
         // We hide all types of notifications once the user clicks on them because the common
         // outcome of clicking should be the relevant window being brought forward and the user's
         // attention switching to the window.
@@ -2390,7 +2390,7 @@ const MessageTray = new Lang.Class({
                         this.add(source);
                         let notification = new Notification(source, ngettext("%d new message", "%d new messages", len).format(len));
                         notification.setTransient(true);
-                        notification.connect('clicked', Lang.bind(this, function() {
+                        notification.connect('activated', Lang.bind(this, function() {
                             this.openTray();
                         }));
                         source.notify(notification);
index edd32c83147a5fe35b72799daf77bc838e430be5..3731a17f3244e787760a8eaf214f573464ca8aed 100644 (file)
@@ -374,11 +374,11 @@ const FdoNotificationDaemon = new Lang.Class({
         }
 
         if (hasDefaultAction) {
-            notification.connect('clicked', Lang.bind(this, function() {
+            notification.connect('activated', Lang.bind(this, function() {
                 this._emitActionInvoked(ndata.id, 'default');
             }));
         } else {
-            notification.connect('clicked', Lang.bind(this, function() {
+            notification.connect('activated', Lang.bind(this, function() {
                 source.open();
             }));
         }
@@ -648,7 +648,7 @@ const GtkNotificationDaemonNotification = new Lang.Class({
         this._activateAction(action.unpack(), actionTarget);
     },
 
-    _onClicked: function() {
+    activate: function() {
         this._activateAction(this._defaultAction, this._defaultActionTarget);
         this.parent();
     },
index 3fcaff6827ab1f420adbee13047bb9cca2062152..d5e23d2f28cd7f0bc79fdff79c7e5fd2e5404f05 100644 (file)
@@ -39,7 +39,7 @@ const WindowAttentionHandler = new Lang.Class({
         let [title, banner] = this._getTitleAndBanner(app, window);
 
         let notification = new MessageTray.Notification(source, title, banner);
-        notification.connect('clicked', function() {
+        notification.connect('activated', function() {
             source.open();
         });
         notification.setForFeedback(true);